package mr.ali.video.web.controller;


import mr.ali.video.web.Exception.R;
import mr.ali.video.web.model.CollectionIndexSelection;
import mr.ali.video.web.service.ICollectionIndexSelectionService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Mr-ali
 * @since 2025-09-08
 */
@RestController
@RequestMapping("/web/collectionIndexSelection")
public class CollectionIndexSelectionController {
    @Resource
    private ICollectionIndexSelectionService collectionIndexSelectionService;


    @GetMapping("/all")
    public List<CollectionIndexSelection> getCollectionIndexSelection() {
        return collectionIndexSelectionService.getCollectionIndexSelection();
    }

    @GetMapping("/update")
    public R<CollectionIndexSelection> updateCollectionIndexSelection(CollectionIndexSelection collectionIndexSelection) {
        return R.ok(collectionIndexSelectionService.updateCollectionIndexSelection(collectionIndexSelection));
    }
}
